2020-2021 Sunseeker Telemetry and Lighting System
adc12_a_ex6_extendedInputs.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void main (void)
 
void ADC12ISR (void)
 

Variables

volatile uint16_t results [2]
 

Function Documentation

◆ ADC12ISR()

void ADC12ISR ( void  )

Definition at line 177 of file adc12_a_ex6_extendedInputs.c.

References __bic_SR_register_on_exit(), and results.

◆ main()

void main ( void  )

Definition at line 83 of file adc12_a_ex6_extendedInputs.c.

References __no_operation().

Variable Documentation

◆ results

volatile uint16_t results[2]

ADC12_A - Sample A8 & A9 as Inputs, AVcc Ref

This example shows how to perform A/D conversion on up to 10 external channels by showing that channels A8 and A9 can be used for conversion of external signals when not using these channels as external reference inputs. A single sequence of conversions is performed - one conversion on A8 and then one conversion on A9. Each conversion uses AVcc and AVss for the references. The conversion results are stored in ADC12MEM0 and ADC12MEM1 respectively and are moved to 'results[]' upon completion of the sequence. Test by applying voltages to pins VeREF+ for A8 and VREF-/VeREF- for A9, then setting and running to a break point at the "_BIC..." instruction in the ISR. To view the conversion results, open a watch window in debugger and view 'results' or view ADC12MEM0 and ADC12MEM1 in an ADC12_A SFR window. This can run even in LPM4 mode as ADC has its own clock

NOTE: When using channels A8 and A9 for external signals, internal references must be used for the conversions. Refer to figure 18-1 in the MSP430x5xx Family User's Guide.

          MSP430F552x
       -----------------
   /|\|                 |
    | |                 |
    --|RST     A8/VeREF+|<- Vin1
      |  A9/VREF-/VeREF-|<- Vin2
      |                 |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • ADC12_A peripheral
  • GPIO Port peripheral
  • A8/VeREF+
  • A9/VREF-/VeREF-

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • ADC12_A_VECTOR

Definition at line 81 of file adc12_a_ex6_extendedInputs.c.

Referenced by ADC12ISR().